<template>
    <view class="w-96 h-96 b-96 f ai-c jc-c fd-c to-top" @click="toTop">
        <image src="http://cwht.ricecs.cn/app/shop/top.png" class="w-24 h-26"></image>
        <view class="fs-24 fw-500 text-color4 mt-4">顶部</view>
    </view>
</template>
<script setup lang="ts">
//回到顶部
const toTop = () => {
    uni.pageScrollTo({
        scrollTop: 0,
        duration: 200,
    });
};
</script>
<style lang="scss" scoped>
.to-top {
    border: 1rpx solid #dddddd;
    box-shadow: 0 2rpx 12rpx 0 #0000000f;
    position: fixed;
    right: 20rpx;
    bottom: 200rpx;
    background: #fff;
}
</style>
